<?php

include '../function.php'; 

$data = $_FILES['upload'];

$exts = ['jpg','gif','png','sql'];

if($data['error']==0){
	$arr = explode('.', $data['name']);
	$ext = end($arr);

	if(in_array($ext, $exts)){

		if($data['size']<100000){

			$name = uniqid();

			move_uploaded_file($data['tmp_name'], "./Upload/".$name.".".$ext);

		}else{
			echo "文件大小不符合";
		}

	}else{
		echo "不允许上传类型，请重新上传";
	}


}else{
	echo "上传失败,错误代码:".$data['error'];
}











 ?>